#region Summary 

// 
// Owner : JackieHan 
// 
// Solution : TestStringContract 
// 
// Project : TestStringContract 
// 
// File : TestStringContract.cs 
// 
// CopyRight : Copyright © 2009-2010 XunGu Corporation, All Rights Reserved 
// 
// Summary : 测试字符串连接 
// 
// History : 
//			2010-04-26 15:04:17	    Create 
// 

#endregion

#region Using 

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace TestStringContract
{
    /// <summary> 
    /// 测试字符串连接 
    /// </summary> 
    public class TestStringContract
    {
        private static void StringAddInt()
        {
            string a = "b" + 1;
        }

        public static void StringAddString()
        {
            var sb = new StringBuilder();
            sb.Append("B");
            sb.Append(1.ToString());

            //string a = "b" + 1.ToString();
        }

        public static void StringBuilde()
        {
            var sb = new StringBuilder();
            sb.Append("B");
            sb.Append(1);
        }

        static void Main(string[] args)
        {
            int iteration = 1000000;

            CodeTimer.CodeTimer.Initialize();

            CodeTimer.CodeTimer.Time("StringAddInt", iteration, StringAddInt);

            CodeTimer.CodeTimer.Time("StringBuilder", iteration, StringBuilde);

            CodeTimer.CodeTimer.Time("StringAddString", iteration, StringAddString);
        }
    }
}
